#include "module_window_property.h"
#include "ui_module_window_property.h"

//#include "mainwindow.h"

#include <QDebug>

module_window_property::module_window_property(Module_Data data, QWidget *parent) :
    QFrame(parent),
    ui(new Ui::module_window_property)
{
    ui->setupUi(this);

    this->setObjectName("Property");
    //setCursor(Qt::PointingHandCursor);
    this->set_module_attribute(data);

    this->init();
}

module_window_property::~module_window_property()
{
    delete ui;
}

void module_window_property::init()
{
    this->set_name(data.get_module_name());
    this->set_type(data.get_module_type());
    this->set_class(data.get_module_class());
}

void module_window_property::set_name(QString name)
{
    ui->lineEdit_Name->setText(name);
}

void module_window_property::set_type(QString type)
{
    ui->label_type->setText(type);
}

void module_window_property::set_class(QString cls)
{
    ui->label_class->setText(cls);
}

void module_window_property::set_module_attribute(Module_Data data)
{
    this->data = data;
}


void module_window_property::on_lineEdit_Name_textChanged(const QString &arg1)
{
    emit this->changeLableName(arg1);  //发送Lable标签更改的信号给module_window
}

